package com.interview.controller;

import com.interview.pojo.Parameter;
import com.interview.service.ParameterService;
import com.interview.utils.DateUtils;
import com.interview.utils.Id_Builder;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/parameter")
public class ParameterController {

    @Resource(name ="ParameterServiceImpl" )
    private ParameterService parameterService;

    // 手动添加字段 和value

    @PostMapping
    public void add(){
        Parameter parameter=new Parameter();
        parameter.setId(Id_Builder.nextId());
        parameter.setParameter_key("recommend_article_time");
        parameter.setParameter_value(DateUtils.dateStrng());
        parameterService.add(parameter);
    }





}
